#include <iostream>
#include <math.h>
#include <float.h>
#include "point.h"
#include "link.h"

using namespace std;

Point::Point(const Point &p){
	this->x = p.x;
	this->y = p.y;
	this->weight = p.weight;
}
Point::Point(float x, float y){
	this->x = x;
	this->y = y;
	this->weight = 0.0f;		
}
Point::~Point(){
}
bool Point::operator==(const Point &p){
        //10*FLT_EPSILON pour d'ouvrire la fenetre d'egaliter entre 2 float
        return (fabs(p.x - x) < 10*FLT_EPSILON && fabs(p.y - y) < 10*FLT_EPSILON);
}
bool Point::operator!=(const Point &p){
	return !((*this) == p);
}
void Point::setX(float x){
	this->x = x;
}
void Point::setY(float y){
	this->y = y;
}
void Point::setWeight(float weight){
	this->weight = weight;
}
float Point::getX(){
	return this->x;
}
float Point::getY(){
	return this->y;
}
float Point::getWeight(){
	return this->weight;
}
ostream & operator<<( ostream & out, Point p){
    out << p.getX() << "," << p.getY();
    return out;
}
